<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:ace="http://www.icefaces.org/icefaces/components"
    xmlns:ice="http://www.icesoft.com/icefaces/component"
    xmlns:icecore="http://www.icefaces.org/icefaces/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    template="/resources/templates/main-template.xhtml">
    
    <ui:param name="title" value="#{msgs[dataTableBean.title]}"/>
    <ui:param name="description" value="#{msgs[dataTableBean.description]}"/>
    <ui:param name="subMenuTitle" value="#{msgs[dataTableBean.subMenuTitle]}"/>
    <ui:param name="subMenuLinks" value="#{dataTableBean.subMenuLinks}"/>
    <ui:param name="resourceValue" value="#{dataTableBean.exampleResource}"/>
    
    <ui:param name="wikiResources" value="#{dataTableResources.wikiResources}"/>
    <ui:param name="tldResources" value="#{dataTableResources.tldResources}"/>
    <ui:define name="component-main">
		<h:form id="form1">
			<h:panelGroup>
				<h:outputLabel value="Login user:"></h:outputLabel>
				<h:inputText value="#{priceMngBean.userId}" readonly="true">
				</h:inputText>
			</h:panelGroup>
			<hr />
			<h:panelGroup>

				<h:messages />
			</h:panelGroup>

			<h:panelGrid id="panelGrid1" columns="4" styleClass="icePnlGrd">

				<h:outputLabel value="UPC:"></h:outputLabel>
				<h:inputText value="#{priceMngBean.article.articleUPC}" />

				<h:outputLabel value="Name:"></h:outputLabel>
				<h:inputText value="#{priceMngBean.article.articleName}" />

				<h:outputLabel value="Specification:"></h:outputLabel>
				<h:inputText value="#{priceMngBean.article.specification}" />

				<h:outputLabel value="packageNet:"></h:outputLabel>
				<h:inputText value="#{priceMngBean.article.packageNet}" />

				<h:outputLabel value="brand:"></h:outputLabel>
				<h:inputText value="#{priceMngBean.article.brand}" />
			</h:panelGrid>
			<hr />
			<h:panelGrid id="panelGrid2" columns="6" styleClass="icePnlGrd">
				<ice:dataTable value="#{priceMngBean.article.priceRecords}"
					var="priceRecord">
					<ice:column>
						<f:facet name="header">Store</f:facet>
						<h:inputText value="#{priceRecord.location}" />
					</ice:column>
					<ice:column>
						<f:facet name="header">Date</f:facet>
						<h:inputText value="#{priceRecord.priceDate}">
							<f:convertDateTime dateStyle="short" />
						</h:inputText>
					</ice:column>
					<ice:column>
						<f:facet name="header">Price</f:facet>
						<h:inputText value="#{priceRecord.price}" />
					</ice:column>
				</ice:dataTable>
			</h:panelGrid>
			<h:commandButton value="Back" action="#{priceMngBean.queryArticle}"></h:commandButton>
			<h:commandButton value="Save" action="#{priceMngBean.saveArticle}"></h:commandButton>
		</h:form>
    </ui:define>
</ui:composition>